/*
 * @Author: LC
 * @Date: 2021-10-08
 * @Description:
 */
'use strict';
export default app => {

  const { STRING, INTEGER } = app.Sequelize;
  // 角色表
  const Role = app.model.define('Role', {
    id: {
      primaryKey: true,
      type: INTEGER,
      autoIncrement: true,
      comment: '角色id',
    },
    name: {
      type: STRING(50),
      defaultValue: null,
      comment: '角色名称',
    },
    description: {
      type: STRING(300),
      defaultValue: null,
      comment: '角色描述',
    },
    status: {
      type: INTEGER,
      defaultValue: 1,
      comment: '角色状态',
    },
    sort: {
      type: INTEGER,
      defaultValue: 0,
      comment: '角色排序',
    },
    createTime: {
      type: INTEGER,
      defaultValue: null,
      comment: '创建时间',
    },
    updateTime: {
      type: INTEGER,
      defaultValue: null,
      comment: '更新时间',
    },
  },
  {
    tableName: 'role',
    comment: '角色表',
    timestamps: false,
  },
  );

  return Role;
};
